"""
 占位符, feed数据填充和fetch数据获取
"""

import tensorflow as tf

a = tf.compat.v1.placeholder(tf.float32, name="a")
b = tf.compat.v1.placeholder(tf.float32, name="b")
c = tf.multiply(a, b, name="c")

init = tf.compat.v1.global_variables_initializer()

with tf.compat.v1.Session() as sess:
    sess.run(init)
    '''通过feed_dict传参数, 按字典格式'''
    result = sess.run(c, feed_dict={a: 3.0, b: 4.0})

    print(result)
